<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
//use Illuminate\Support\Facades\Schema;

class AddDiseaseTable20230907 extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        if (!Schema::hasTable('health_disease_discern_class')) {
            Schema::create('health_disease_discern_class', function (Blueprint $table) {
                $table->id();
                $table->integer('pid')->default(0)->index()->comment('上级ID');
                $table->string('name')->comment('名称');
                $table->string('icon')->default('')->comment('图标');
                $table->tinyInteger('is_show')->default(1)->comment('是否显示 1-是 0-否');
                $table->timestamps();
                $table->comment = '病症鉴别分类表';
            });
        }

        if (!Schema::hasTable('health_disease_discern')) {
            Schema::create('health_disease_discern', function (Blueprint $table) {
                $table->id();
                $table->integer('class_id')->unsigned()->index()->comment('分类id');
                $table->string('name')->comment('名称');
                $table->string('img')->comment('图片');
                $table->longText('text')->nullable()->comment('病症鉴别与选穴');
                $table->longText('treat_text')->nullable()->comment('调理建议');
                $table->tinyInteger('is_show')->default(1)->comment('是否显示 1-是 0-否');
                $table->timestamps();
                $table->comment = '病症鉴别表';
            });
        }
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        //
    }
}
